import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
	state: {
		userInfo: null,
		token: '',
	},
	mutations: {
		saveUserInfo(state, user) {
			state.userInfo = user;
			uni.setStorageSync("userInfo", user)
		},
		saveToken(state, token) {
			state.token = token;
			uni.setStorageSync("token", token)
		}
	}
})
